******************** PROGRAMA PRINCIPAL DEL PROYECTO ZSISCOL **********************

CLEAR MACROS
SET SYSMENU OFF
SET TALK OFF
SET NOTIFY OFF  && Desactiva los mensajes del sistema
SET ESCAPE ON
SET SAFETY OFF 
SET BELL OFF
SET DELETE ON
SET DATE TO BRITISH
SET CURSOR ON
SET EXCL OFF
SET AUTOSAVE ON
SET EXACT ON
*SET RESOURCE TO C:\ZSISCOL\FOXUSER.DBF				&& HAY QUE ACTIVARLO YA EN EL EXE
SET MESSAGE TO ' '
SET LIBRARY TO FOXTOOLS.FLL ADDITIVE
*SET CLASSLIB TO ESQUEMAS ADDITIVE
SET CENTURY ON
SET FDOW TO 1		&& EL PRIMER DIA DE LA SEMANA ES LUNES
SET ASSERTS ON




xsosdir    = LEFT(SYS(16),RAT("\",SYS(16)))
PathDrive = LEFT(xsosdir, 2)
PathPrin  = STUFF(xsosdir, 1, 2, '')				
PathDBFS  = PathPrin+'DATOS\'
PathPant  = PathPrin+'SCREEN\'
PathPrgs  = PathPrin+'PRGS\'
PathMenus = PathPrin+'MENUS\'
PathBMP   = PathPrin + 'BMPS\'
PathREP   = PathPrin+'REPORT\'
PathUtil  = PathPrin + 'LIBS\'
PathSist2  = PathDrive + PathPrin

PathSist  = PathDrive + PathPrin +';'+ PathPant +';'+ PathMenus  +';'+ ;
			PathPrgs +';'+ PathDBFS +';'+ PathBMP +';'+ PathREP +';'+ PathUtil       

*PathSist  = PathDrive + PathPrin +';'+ PathDBFS        

SET DEFA TO &PathSist2
SET PATH TO &PathSist

MacroSave = "Macro.FKY"
IF .NOT. FILE(MacroSave)
   SAVE MACROS TO (MacroSave)
ENDIF
*--------------------------------- DEFINICION DE VARIABLES PUBLICAS ---------------------------------------------*
*																												 *
*																												 *
*																												 *
*********** PUBLICAS PARA CONTROL DEL SISTEMA ****************
PUBLIC ARRAY AR_grados[15]


AR_grados[1] = 'Kinder 1'
AR_grados[2] = 'Kinder 2'
AR_grados[3] = 'Kinder 3'
AR_grados[4] = 'Primaria 1'
AR_grados[5] = 'Primaria 2'
AR_grados[6] = 'Primaria 3'
AR_grados[7] = 'Primaria 4'
AR_grados[8] = 'Primaria 5'
AR_grados[09] = 'Primaria 6'
AR_grados[10] = 'Secundaria 1'
AR_grados[11] = 'Secundaria 2'
AR_grados[12] = 'Secundaria 3'
AR_grados[13] = 'Preparatoria 1'
AR_grados[14] = 'Preparatoria 2'
AR_grados[15] = 'Preparatoria 3'


*********** DEFINE VARIABLES PUBLICAS DE FECHAS ****************
PUBLIC ARRAY AR_MES[13,2]
AR_MES[1,1]='Enero'
AR_MES[2,1]='Febrero'
AR_MES[3,1]='Marzo'
AR_MES[4,1]='Abril'
AR_MES[5,1]='Mayo'
AR_MES[6,1]='Junio'
AR_MES[7,1]='Julio'
AR_MES[8,1]='Agosto'
AR_MES[9,1]='Septiembre'
AR_MES[10,1]='Octubre'
AR_MES[11,1]='Noviembre'
AR_MES[12,1]='Diciembre'
AR_MES[13,1]='Fin/Ejerc'

AR_MES[1,2]=31     
AR_MES[2,2]=29        
AR_MES[3,2]=31      
AR_MES[4,2]=30     
AR_MES[5,2]=31    
AR_MES[6,2]=30      
AR_MES[7,2]=31      
AR_MES[8,2]=31      
AR_MES[9,2]=30           
AR_MES[10,2]=31       
AR_MES[11,2]=30           
AR_MES[12,2]=31            
AR_MES[13,2]=31            

Vtemp=CTOD('29/02/'+right(str(year(date())),2))
IF Vtemp=CTOD('  /  /  ')
	AR_MES[2,2]=28        
ENDIF

****************** DEFINE VARIABLES PUBLICAS DE TEXTO ***********************
PUBLIC ARRAY AR_TEXTJUS[1]
****************************************************************


SET PROCEDURE TO FUNCS
*ON ERROR DO CTRLERR ;
*   WITH PROGRAM(),LINENO(),ERROR(),MESSAGE(),MESSAGE(1)		&& ESTA EN FUNCS.PRG

ON SHUTDOWN DO Terminar

******* DEFINE VARIABLES PUBLICAS DE ACCESO DE USUARIOS *********
PUBLIC G_usuario
PUBLIC ARRAY A_ACCESO[7,10]
A_ACCESO[7,1] = .T.			&& HABILITA OPCION SALIR
*****************************************************************


***** ABRE LA BASE DE DATOS PRINCIPAL *****
*OPEN DATABASE c:\zadmin\datos\PRINCIP1.dbc SHARED

IF !USED('CONFIG')
	USE CONFIG ALIAS CONFIG IN 0 SHARED
	GO TOP IN CONFIG
ENDIF
*********************************************

******* INICIALIZA LA PANTALLA PRINCIPAL ****************
_SCREEN.CAPTION = "Z-SISCOL  " + ALLTRIM(CONFIG.EMPRESA) + "Ciclo Escolar:" + CONFIG.CICLO
_SCREEN.WINDOWSTATE = 2
**********************************************************

*ON ERROR DO CTRLERR ;
 *  WITH PROGRAM(),LINENO(),ERROR(),MESSAGE(),MESSAGE(1)		&& ESTA EN FUNCS.PRG
*DO FORM CLAVE
*DISP MEMO LIKE A_ACCESO*

*================== INICIALIZACION DE VARIABLES GLOBALES DE CONTROL ========================*
*																							*
*																							*

DO FORM ClaveEntra TO G_Usuario
IF EMPTY(G_Usuario)
	DO Terminar
	CANCEL
ELSE
	HaceAcceso()
	DO MENU01.MPR
	READ EVENTS
ENDIF
